package ge.lowlevel;



import ge.exceptions.FunctionNonSuported;

public class SoundEngine 
{
	protected static SoundEngine delegated;
	public SoundEngine()
	{
		
	}
	/**
	 * 	Sets the concrete engine
	 * @param engine
	 */
	static public  void set(SoundEngine engine)
	{
		delegated = engine;
	}
	/**
	 * 	
	 * @return gets the concrete SoundEngine
	 */
	static public SoundEngine get()
	{
		return delegated;
	}
	/**
	 * 	Plays a Sound
	 * @param id Identifier of the song. 
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void play(String id) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","play");
	}
	
	/**
	 * 	Stops the sound with that id if it's signing now
	 * @param id Identifier of the song. 
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void stop(String id) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","stop");
	}
	/**
	 * 	Pauses the actual song. It'll continue in the same second if you try to put it playing again.
	 * @param id Identifier of the song
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void pause(String id)  throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","pause");
	}
	/**
	 * 	Sets the level of volume for of the sounds
	 * @param volume
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void setVolume(double volume) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","setVolume");
	}
	/**
	 * 	Tests if the id song has finished
	 * @param id	Id sound
	 * @return	True if it has finished. False if is still sounding or if it's stopped for stopped function.
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public boolean isEnd(String id) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","setVolume");
	}
	/**
	 * 	A song can be composed for different sources. That function want's help
	 * 	browsers who doesn't support the same song formats. 
	 * 	With add function you can add different songs formats (mp3, ogg, wav), and the 
	 * 	sound engine will choose the format it can understand. 
	 * @param id	Id of the song.
	 * @param urlSong Source fo the song
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void add(String id, String urlSong) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","setVolume");
	}
	/**
	 * 	Plays music in the background. It can be only one music singing at same time.
	 * 	You can just give time a empty value "" for stop the music. If you give a new
	 * 	music url the one who is now singing will be stopped and changed for the new one.
	 * @param urlSound url of the music
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void playMusic(String urlSound) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","playMusic");
	}
	
	/**
	 * 	Sets the level of volume for of the music
	 * @param volume It has to be between 0-1
	 * @throws FunctionNonSuported if the engine doesn't support it
	 */
	public void setMusicVolume(float volume) throws FunctionNonSuported
	{
		throw new FunctionNonSuported("Sound Engine","setMusicVolume");
	}
	
}
